<?php

class Helloworld extends CI_Controller
{
    function index()
    {
        echo 'HelloWorld!';
    }

    function hello()
    {
        echo '你好Hello啊 123456!';
    }

    public function view()
    {
        echo 'view  123456!';
    }

    function view2($page)
    {
        echo 'view2 222222  123456!'.$page;
    }

    function view3($page = 'home')
    {
        echo 'view33333333333  123456!'.'      '.APPPATH . 'views/pages/' . $page . '.php';
        if (!file_exists(APPPATH . 'views/pages/' . $page . '.php')) {
            show_404();
        }

    }


    function view4($page = 'home')
    {
        if (!file_exists(APPPATH . 'views/pages/' . $page . '.php')) {
            show_404();
        }
        $data = array();
        $data['title'] = ucfirst($page);

        $this->load->view('templates/header', $data);
        $this->load->view('pages/'.$page, $data);
       // $this->load->view('templates/footer', $data);

    }
}

;